package stripsLanguage;

/**
 * polaczenie potrzebne do planu
 * @author Lukasz
 *
 */

public class Link {

	/** a step that is a source of the link **/
	private Step FirstStep;
	
	/** a step that is an and of the link **/
	private Step LastStep;
	
	/** a predicate that is fulfilled with this link**/
	private Predicate FullfilledPredicate;

	public Link(
		Step firstStep,
		Step lastStep,
		Predicate fullfilledPredicate)
	{
		FirstStep = firstStep;
		LastStep = lastStep;
		FullfilledPredicate = fullfilledPredicate;
	}
	
	public Step getFirstStep() {
		return FirstStep;
	}

	public Step getLastStep() {
		return LastStep;
	}
	
	public Predicate getFullilledPredicate() {
		return FullfilledPredicate;
	}
	
	public String toString()
	{
		return "(" + FirstStep.getId() + "," + FirstStep.getName()
			+ " -> " + FullfilledPredicate.getIdOfPredicate() + "," + FullfilledPredicate.getName()
			+ " -> " + LastStep.getId() + "," + LastStep.getName() + ")";
	}
}
